{"ast":null,"code":"import classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Popover from '../popover';\nimport { cloneElement } from '../_util/reactNode';\nimport Avatar from './avatar';\nimport { SizeContextProvider } from './SizeContext';\nimport useStyle from './style';\nconst Group = props => {\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className = '',\n    maxCount,\n    maxStyle,\n    size\n  } = props;\n  const prefixCls = getPrefixCls('avatar', customizePrefixCls);\n  const groupPrefixCls = `${prefixCls}-group`;\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const cls = classNames(groupPrefixCls, {\n    [`${groupPrefixCls}-rtl`]: direction === 'rtl'\n  }, className, hashId);\n  const {\n    children,\n    maxPopoverPlacement = 'top',\n    maxPopoverTrigger = 'hover'\n  } = props;\n  const childrenWithProps = toArray(children).map((child, index) => cloneElement(child, {\n    key: `avatar-key-${index}`\n  }));\n  const numOfChildren = childrenWithProps.length;\n  if (maxCount && maxCount < numOfChildren) {\n    const childrenShow = childrenWithProps.slice(0, maxCount);\n    const childrenHidden = childrenWithProps.slice(maxCount, numOfChildren);\n    childrenShow.push( /*#__PURE__*/React.createElement(Popover, {\n      key: \"avatar-popover-key\",\n      content: childrenHidden,\n      trigger: maxPopoverTrigger,\n      placement: maxPopoverPlacement,\n      overlayClassName: `${groupPrefixCls}-popover`\n    }, /*#__PURE__*/React.createElement(Avatar, {\n      style: maxStyle\n    }, `+${numOfChildren - maxCount}`)));\n    return wrapSSR( /*#__PURE__*/React.createElement(SizeContextProvider, {\n      size: size\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      className: cls,\n      style: props.style\n    }, childrenShow)));\n  }\n  return wrapSSR( /*#__PURE__*/React.createElement(SizeContextProvider, {\n    size: size\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: cls,\n    style: props.style\n  }, childrenWithProps)));\n};\nexport default Group;","map":{"version":3,"names":["classNames","toArray","React","ConfigContext","Popover","cloneElement","Avatar","SizeContextProvider","useStyle","Group","props","getPrefixCls","direction","useContext","prefixCls","customizePrefixCls","className","maxCount","maxStyle","size","groupPrefixCls","wrapSSR","hashId","cls","children","maxPopoverPlacement","maxPopoverTrigger","childrenWithProps","map","child","index","key","numOfChildren","length","childrenShow","slice","childrenHidden","push","createElement","content","trigger","placement","overlayClassName","style"],"sources":["/data/messenger.client/node_modules/antd/es/avatar/group.js"],"sourcesContent":["import classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Popover from '../popover';\nimport { cloneElement } from '../_util/reactNode';\nimport Avatar from './avatar';\nimport { SizeContextProvider } from './SizeContext';\nimport useStyle from './style';\nconst Group = props => {\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className = '',\n    maxCount,\n    maxStyle,\n    size\n  } = props;\n  const prefixCls = getPrefixCls('avatar', customizePrefixCls);\n  const groupPrefixCls = `${prefixCls}-group`;\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const cls = classNames(groupPrefixCls, {\n    [`${groupPrefixCls}-rtl`]: direction === 'rtl'\n  }, className, hashId);\n  const {\n    children,\n    maxPopoverPlacement = 'top',\n    maxPopoverTrigger = 'hover'\n  } = props;\n  const childrenWithProps = toArray(children).map((child, index) => cloneElement(child, {\n    key: `avatar-key-${index}`\n  }));\n  const numOfChildren = childrenWithProps.length;\n  if (maxCount && maxCount < numOfChildren) {\n    const childrenShow = childrenWithProps.slice(0, maxCount);\n    const childrenHidden = childrenWithProps.slice(maxCount, numOfChildren);\n    childrenShow.push( /*#__PURE__*/React.createElement(Popover, {\n      key: \"avatar-popover-key\",\n      content: childrenHidden,\n      trigger: maxPopoverTrigger,\n      placement: maxPopoverPlacement,\n      overlayClassName: `${groupPrefixCls}-popover`\n    }, /*#__PURE__*/React.createElement(Avatar, {\n      style: maxStyle\n    }, `+${numOfChildren - maxCount}`)));\n    return wrapSSR( /*#__PURE__*/React.createElement(SizeContextProvider, {\n      size: size\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      className: cls,\n      style: props.style\n    }, childrenShow)));\n  }\n  return wrapSSR( /*#__PURE__*/React.createElement(SizeContextProvider, {\n    size: size\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: cls,\n    style: props.style\n  }, childrenWithProps)));\n};\nexport default Group;"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,mBAAmB,QAAQ,eAAe;AACnD,OAAOC,QAAQ,MAAM,SAAS;AAC9B,MAAMC,KAAK,GAAGC,KAAK,IAAI;EACrB,MAAM;IACJC,YAAY;IACZC;EACF,CAAC,GAAGV,KAAK,CAACW,UAAU,CAACV,aAAa,CAAC;EACnC,MAAM;IACJW,SAAS,EAAEC,kBAAkB;IAC7BC,SAAS,GAAG,EAAE;IACdC,QAAQ;IACRC,QAAQ;IACRC;EACF,CAAC,GAAGT,KAAK;EACT,MAAMI,SAAS,GAAGH,YAAY,CAAC,QAAQ,EAAEI,kBAAkB,CAAC;EAC5D,MAAMK,cAAc,GAAI,GAAEN,SAAU,QAAO;EAC3C,MAAM,CAACO,OAAO,EAAEC,MAAM,CAAC,GAAGd,QAAQ,CAACM,SAAS,CAAC;EAC7C,MAAMS,GAAG,GAAGvB,UAAU,CAACoB,cAAc,EAAE;IACrC,CAAE,GAAEA,cAAe,MAAK,GAAGR,SAAS,KAAK;EAC3C,CAAC,EAAEI,SAAS,EAAEM,MAAM,CAAC;EACrB,MAAM;IACJE,QAAQ;IACR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